﻿/** @file
 * ITE Display Control Board Scene Definition.
 *
 * @author 
 * @version 1.0
 * @date 2024
 * @copyright ITE Tech. Inc. All Rights Reserved.
 */
/** @defgroup ctrlboard ITE Display Control Board Modules
 *  @{
 */
#ifndef SCENE_H
#define SCENE_H

#include "ite/itu.h"
#include <pthread.h>

enum HMI_PAGE
{
    PAGE_INVAILD = 0x00,
    PAGE_OFF,
    PAGE_MAIN,
    PAGE_BACKUP,
};

struct PageUnite
{
    enum HMI_PAGE   id_;
    bool            is_update_;
    pthread_mutex_t mutex_;
};

#ifdef __cplusplus
extern "C" {
#endif

/** @defgroup ctrlboard_scene Scene
 *  @{
 */

// scene
/**
 * Initializes scene module.
 */
bool SceneInit(void);

/**
 * Exits scene module.
 */
void SceneExit(void);

/**
 * Loads ITU file.
 */
void SceneLoad(void);

/**
 * Runs the main loop to receive events, update and draw scene.
 *
 * @return The QuitValue.
 */
int SceneRun(void);

void selectPage(enum HMI_PAGE pageId);

/**
 * Global instance variable of scene.
 */
extern ITUScene theScene;

/** @} */ // end of ctrlboard_scene

#ifdef __cplusplus
}
#endif

#endif /* SCENE_H */
/** @} */ // end of ctrlboard